﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Grupo3.Objetos
{
    class Inimigo : Objeto2D
    {
        int spriteWidth;
        int spriteHeight;

        Rectangle spriteRect;

        int velocidade = 3;

        Random random = new Random();

        int randomMove;

        public Inimigo(Texture2D textura, Vector2 position) : base(textura, position)
        {
            randomMove= random.Next(0, 4);


        }

        

        public override void Update(GameTime gameTime)
        {
           base.Update(gameTime);

           if (randomMove == 0)
           {
               this.position.X += velocidade;
           }

           else if (randomMove == 1)
           {
               this.position.X -= velocidade;
           }

           else if (randomMove == 2)
           {
               this.position.Y += velocidade;
           }

           else if (randomMove == 3)
           {
               this.position.Y -= velocidade;
           }
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, Color.White);
           base.Draw(spriteBatch);
        }

    }

}

